<template>
    <div>
        <h2>停车管理</h2>
     <van-grid>
         
  <!-- <van-grid-item to="addcar" >
      <img  height="100%" width="100%" src="../assets/car.png"  >
      添加车辆
  </van-grid-item> -->
  
   <van-grid-item icon="logistics" text="添加车辆" to="addcar"> </van-grid-item>
  <van-grid-item icon="manager-o" text="访客预约" to="visitors" >  </van-grid-item>
 
  <van-grid-item icon="upgrade" text="车位查询" @click="onclick"> </van-grid-item>
  <van-grid-item icon="bill-o" text="缴费记录" to="pay"> </van-grid-item>
</van-grid>
 

<br/>
<br/>
<br/>
<div>
<van-card
  
  price="2.00"
  :desc="cars.models"
  :title="cars.carnum"
  thumb="http://qyzts283x.hn-bkt.clouddn.com/R8.png"
>
  <template #tags>
    
    <van-tag plain type="danger">状态：{{cars.status}}</van-tag>
  </template>
  <template #footer>
    <van-button size="mini" to="pay">去缴费</van-button>

  </template>
</van-card>

</div>
    </div>

</template>
<script>
import { Dialog } from 'vant';


export default {


  
  data() {
    return {
      carnum:[],
      status:[],
      cars:[]
    }
  },
  
  methods: {
    onclick(){ Dialog.confirm({
  title: '车位',
  message: '剩余：2',
})
  .then(() => {
    // on confirm
  })
  .catch(() => {
    // on cancel
  });},
  
  },
  created: function () {
    this.$axios.get("car/findCarById?p_id=1").then((response) => {
      
      this.cars = response.data.data;

      console.log(response);
    });

   
 
     
        
    //     this.$axios.get("carnum").
    //     then(res=>{
    //         if(res.data.code==1){
    //             this.car=res.data.data;
    //           }
              
    //     }),
    //     this.$axios.get("status").then(res=>{
    //         if(res.data.code==1){
    //             this.status=res.data.data;
    //           }
    //     })
    // },
    
}
}
</script>


<style>
  .goods-card {
    margin: 0;
    background-color: white;
  }

  .delete-button {
    height: 100%;
  }
</style>

